import java.util.*;

public class Test21 {
    public static void main(String[] args) {
        String s=new String("acgsf");

    }








    public static void main03(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNext()) {
            String s=in.nextLine();
            int left=0,right=s.length()-1;
            int ret=Palindrome(s,left,right);
            System.out.println(ret);
        }
    }

    public static int Palindrome(String s, int left, int right) {
        if(left == right){
            return 0;
        }
        int len = 0;

        if (s.charAt(left) == s.charAt(right)) {
            len += 2;
            len += Palindrome(s, left + 1, right - 1);
        } else {
            int max=0;
            while (left < right - 1) {
                len=0;
                for (int i = right; i > left; i--) {
                    if (s.charAt(left) == s.charAt(i)) {
                        len += 2;
                        len += Palindrome(s, left + 1, right - 1);
                        break;
                    }
                }
                left++;
                max=Math.max(len,max);
            }
            if(max == 0){
                return 1;
            }else{
                return max;
            }
        }
        return len;

    }







    public static void main02(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int n = in.nextInt();
            int[] arr = new int[n];
            int m = in.nextInt();
            int[] brr = new int[m];
            for (int i = 0; i < n; i++) {
                arr[i] = in.nextInt();
            }
            for (int i = 0; i < m; i++) {
                brr[i] = in.nextInt();
            }

            int i = 0, j = 0;
            while (i < n && j < m) {
                if (arr[i] > brr[j]) {
                    System.out.print(brr[j++] + " ");
                } else if (arr[i] < brr[j]) {
                    System.out.print(arr[i++] + " ");
                } else {
                    System.out.print(arr[i] + " ");
                    i++;
                    j++;
                }
            }
            if ( i == n ) {
                while (j < m-1) {
                    System.out.print(brr[j++] + " ");
                }
                if(j == m-1) {
                    System.out.print(brr[j]);
                }
            }else if ( j == m) {
                while (i < n-1) {
                    System.out.print(arr[i++] + " ");
                }
                if(i == n-1) {
                    System.out.print(arr[i]);
                }
            }
        }
    }






    public static void main01(String[] args) {
        Scanner in = new Scanner(System.in);

            int n = in.nextInt();
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = i + 1;
            }
            for(int i=1;i<n-1;i++){
                sort(arr,i);
            }

            for(int i=0;i<n;i++){
                System.out.print(arr[i]+" ");
            }
    }
    public static void sort(int[] arr,int index){
        if(index > 1 &&( arr[index] > arr[index-1] && arr[index] > arr[index+1] || arr[index] < arr[index-1] && arr[index] < arr[index+1])){
            return ;
        }
        if(arr[index] > arr[index-1] && arr[index] < arr[index+1]){
            int tmp=arr[index];
            arr[index]=arr[index+1];
            arr[index+1]=tmp;
            if(index > 1) {
                sort(arr, index - 1);
            }
        }
    }
}
